#include "gamehall.h"
#include "ui_gamehall.h"
#include<QDebug>
#include<fstream>
#include<iostream>
#include<QShortcut>
#include<QFormLayout>
#include<QButtonGroup>
#include<QLineEdit>
#include<QTimer>
#include<windows.h>
#include<QPushButton>
#include<QToolTip>
#include<QDockWidget>
#include<QDialog>
#include<QPushButton>
#include<QStatusBar>
#include<QToolBar>
#include<QMessageBox>
#include<QColorDialog>
#include<QFileDialog>
#include<QFontDialog>
#include<QTimer>
#include<QInputDialog>
#include<QFile>
#include<QFileDevice>
#include<QWaitCondition>
#include<QPaintEvent>
#include<QPainter>
#include"gameselect.h"
GameHall::GameHall(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::GameHall)
{
    ui->setupUi(this);
    this->setFixedSize(1500,1200);
    this->setWindowTitle("贪吃蛇");
    this->setWindowIcon(QIcon(":res/ico.png"));
    QFont font("华文行楷",26);
    QPushButton* pb=new QPushButton(this);
    pb->setGeometry(650,800,200,200);
    pb->setText("开始游戏");
    pb->setFont(font);
    pb->setStyleSheet("QPushButton{border:0px;color:red}");
    gameselect* gh=new gameselect;
    connect(pb,&QPushButton::clicked,this,[=](){
        this->close();
        gh->setGeometry(this->geometry());
        gh->show();
    });

}

GameHall::~GameHall()
{
    delete ui;
}

void GameHall::paintEvent(QPaintEvent *ev)
{
    QPainter* pa=new QPainter(this);
    pa->drawPixmap(0,0,1500,1200,QPixmap(":res/background.png"));



}

